import request from '@/utils/request'

// 查询车间任务列表
export function listTask(query) {
  return request({
    url: '/mes/task/list',
    method: 'get',
    params: query
  })
}

// 查询车间任务详细
export function getTask(id) {
  return request({
    url: '/mes/task/' + id,
    method: 'get'
  })
}

// 新增车间任务
export function addTask(data) {
  return request({
    url: '/mes/task',
    method: 'post',
    data: data
  })
}

// 修改车间任务
export function updateTask(data) {
  return request({
    url: '/mes/task',
    method: 'put',
    data: data
  })
}

// 删除车间任务
export function delTask(id) {
  return request({
    url: '/mes/task/' + id,
    method: 'delete'
  })
}

// 领料清单
export function pickingList(query) {
  return request({
    url: '/mes/task/pickingList',
    method: 'get',
    params: query
  })
}
//申请领料
export function confirmPicking(query){
  return request({
    url: '/mes/task/confirmPicking',
    method: 'post',
    params: query
  })
}

//生成任务卡
export function start(data){
  return request({
    url: '/mes/task/start',
    method: 'post',
    data: data
  })
}


//撤回任务卡
export function revokeTaskCart(query){
  return request({
    url: '/mes/task/revokeTaskCart',
    method: 'post',
    params: query
  })
}

//删除车间任务
export function deleteWskpTask(query){
  return request({
    url: '/mes/task/deleteWskpTask',
    method: 'delete',
    params: query
  })
}